<?php

use IDock\IDock\IDock;
use IDock\Printer\PolicyPaymentPrinter;
use IDock\Printer\Premium\PremiumInquiryPrinter;
use IDock\Printer\PremiumUnderwritingPrinter;
use IDock\Printer\VehicleModelPrinter;
use IDock\Visitor\NonCar\NonCarInquiryVisitor;
use IDock\Visitor\PolicyPaymentVisitor;
use IDock\Visitor\Premium\PremiumCarTaxVisitor;
use IDock\Visitor\Premium\PremiumChargingPileVisitor;
use IDock\Visitor\Premium\PremiumCoverageVisitor;
use IDock\Visitor\Premium\PremiumExtInfoVisitor;
use IDock\Visitor\Premium\PremiumInquiryVisitor;
use IDock\Visitor\Premium\PremiumRelationVisitor;
use IDock\Visitor\Premium\PremiumUnderwritingVisitor;
use IDock\Visitor\Premium\PremiumVehicleVisitor;
use IDock\Visitor\ProposalStatusVisitor;
use IDock\Visitor\RenewalInquiryVisitor;
use IDock\Visitor\SpecialClausesVisitor;
use IDock\Visitor\UploadFileVisitor;
use IDock\Visitor\VehicleModelVisitor;

require_once('./vendor/autoload.php');

$IDock = new IDock();
$shortName = 'TAIC';

$TAICConfig = [
    'gateway' => '......',
    'openId' => '......',
    'token' => '......',
    'sign' => '......',
    'logsDir' => './TAICLogs',
    'timeout' => '10',
    'proxy' => '......',
];

require_once('config.php');

$IDock->setBean($shortName, $TAICConfig);

global $testResponse;

$vin = 'LB37752ZXJL597845';
$engineNo = '7298261';
$licenseNo = '川A470W6';
$firstRegisterDate = '2018-12-25';
$vehicleModel = '领克牌JL6453C10';

$biStartData = '2023-12-10 00:00:00';
$ciStartData = '2023-12-10 00:00:00';
$biEndData = '2024-12-09 23:59:59';
$ciEndData = '2024-12-09 23:59:59';

$cityCode = '3510001';

//续保 -- 已废弃
if (0) {
    //续保查询接口
    $renewalInquiryVisitor = new RenewalInquiryVisitor();
    //车架号
    $renewalInquiryVisitor->vin = $vin;
    //发动机号
    $renewalInquiryVisitor->engineNo = $engineNo;
    //车牌号
    $renewalInquiryVisitor->licenseNo = $licenseNo;
    $renewalInquiryVisitor->argc['type'] = 1;

    $response = $IDock->renewalInquiry($shortName, $renewalInquiryVisitor);

    if (!$response->isSuccess()) {
        var_dump($response->getError());
    } else {
        var_dump($response->getPrinter());
    }
    exit;
}

//车型获取
if (0) {

    $vehicleModelVisitor = new VehicleModelVisitor();
    //车架号
    $vehicleModelVisitor->vin = $vin;
    //发动机号
    $vehicleModelVisitor->engineNo = $engineNo;
    //车牌号
    $vehicleModelVisitor->licenseNo = $licenseNo;
    //初登时间
    $vehicleModelVisitor->firstRegisterDate = $firstRegisterDate;
    //车型编码
    $vehicleModelVisitor->vehicleModel = $vehicleModel;

    $vehicleModelVisitor->argc['cityCode'] = $cityCode;
    $testResponse = '{"dealFlag":"1","dealMessage":"车型查询成功","resultDTO":{"resultCode":"SUCCESS","resultMess":"统一平台调用成功"},"tmbVehicleInfo":{"enginNo":"L9CB4719394","enrollDate":"2020-12-01","frameNo":"L6T7824Z0LW137597","licenseNo":"川XBP558","licenseType":"02"},"total":9,"vehicleModelList":[{"actualValue":69864.4,"brandName":"吉利","carName":"缤瑞","ecdemicVehicleFlag":"1","exhaustCapacity":1398,"fuelType":"0","hyModelCode":"BJLHBDUC0005","importFlag":"国产车","marketDate":"202012","noticeType":"MR7142D20","powerTypeCode":"D1","purchasePrice":89800,"rbcode":"BRD1100ZJJ","seatCount":5,"vehicleJingyouDto":{"brandName":"吉利","familyName":"缤瑞","price":89800,"priceType":"01","vehicleCode":"BRD1100ZJJ","vehicleName":"吉利美日MR7142D20轿车"},"vehicleStyleDesc":"CVT 亚运版 国Ⅵ","vehicleTonnage":0,"vehicleWeight":1360},{"actualValue":69864.4,"brandName":"吉利","carName":"缤瑞","ecdemicVehicleFlag":"1","exhaustCapacity":1398,"fuelType":"0","hyModelCode":"CJLHBDUD0013","importFlag":"国产车","marketDate":"202012","noticeType":"MR7142D20","powerTypeCode":"D1","purchasePrice":89800,"rbcode":"BRD1100ZJJ","seatCount":5,"vehicleJingyouDto":{"brandName":"吉利","familyName":"缤瑞","price":89800,"priceType":"01","vehicleCode":"BRD1100ZJJ","vehicleName":"吉利美日MR7142D20轿车"},"vehicleStyleDesc":"CVT 亚运版 国Ⅵ","vehicleTonnage":0,"vehicleWeight":1360},{"actualValue":70642.4,"brandName":"吉利","carName":"缤瑞","ecdemicVehicleFlag":"1","exhaustCapacity":1398,"fuelType":"0","hyModelCode":"CJLHBDUD0013","importFlag":"国产车","marketDate":"202006","noticeType":"MR7142D20","powerTypeCode":"D1","purchasePrice":90800,"rbcode":"BRD1081ZJJ","seatCount":5,"vehicleJingyouDto":{"brandName":"吉利","familyName":"缤瑞","price":90800,"priceType":"01","vehicleCode":"BRD1081ZJJ","vehicleName":"吉利美日MR7142D20轿车"},"vehicleStyleDesc":"CVT 亚运版 改款 国Ⅵ","vehicleTonnage":0,"vehicleWeight":1360},{"actualValue":70642.4,"brandName":"吉利","carName":"缤瑞","ecdemicVehicleFlag":"1","exhaustCapacity":1398,"fuelType":"0","hyModelCode":"BJLHBDUC0005","importFlag":"国产车","marketDate":"202006","noticeType":"MR7142D20","powerTypeCode":"D1","purchasePrice":90800,"rbcode":"BRD1081ZJJ","seatCount":5,"vehicleJingyouDto":{"brandName":"吉利","familyName":"缤瑞","price":90800,"priceType":"01","vehicleCode":"BRD1081ZJJ","vehicleName":"吉利美日MR7142D20轿车"},"vehicleStyleDesc":"CVT 亚运版 改款 国Ⅵ","vehicleTonnage":0,"vehicleWeight":1360},{"actualValue":79200.4,"brandName":"吉利","carName":"缤瑞","ecdemicVehicleFlag":"1","exhaustCapacity":1398,"fuelType":"0","hyModelCode":"CJLHBDUD0012","importFlag":"国产车","marketDate":"202012","noticeType":"MR7142D20","powerTypeCode":"D1","purchasePrice":101800,"rbcode":"BRD1098ZJJ","seatCount":5,"vehicleJingyouDto":{"brandName":"吉利","familyName":"缤瑞","price":101800,"priceType":"01","vehicleCode":"BRD1098ZJJ","vehicleName":"吉利美日MR7142D20轿车"},"vehicleStyleDesc":"CVT F-TYPE旗舰版 国Ⅵ","vehicleTonnage":0,"vehicleWeight":1360},{"actualValue":65196.4,"brandName":"吉利","carName":"缤瑞","ecdemicVehicleFlag":"1","exhaustCapacity":1398,"fuelType":"0","hyModelCode":"CJLHBDUF0001","importFlag":"国产车","marketDate":"202012","noticeType":"MR7142D20","powerTypeCode":"D1","purchasePrice":83800,"rbcode":"BRD1101ZJJ","seatCount":5,"vehicleJingyouDto":{"brandName":"吉利","familyName":"缤瑞","price":83800,"priceType":"01","vehicleCode":"BRD1101ZJJ","vehicleName":"吉利美日MR7142D20轿车"},"vehicleStyleDesc":"CVT F-TYPE运动版 国Ⅵ","vehicleTonnage":0,"vehicleWeight":1360},{"actualValue":65196.4,"brandName":"吉利","carName":"缤瑞","ecdemicVehicleFlag":"1","exhaustCapacity":1398,"fuelType":"0","hyModelCode":"BJLHBDUD0009","importFlag":"国产车","marketDate":"202006","noticeType":"MR7142D20","powerTypeCode":"D1","purchasePrice":83800,"rbcode":"BRD1080ZJJ","seatCount":5,"vehicleJingyouDto":{"brandName":"吉利","familyName":"缤瑞","price":83800,"priceType":"01","vehicleCode":"BRD1080ZJJ","vehicleName":"吉利美日MR7142D20轿车"},"vehicleStyleDesc":"CVT 豪华型 国Ⅵ","vehicleTonnage":0,"vehicleWeight":1360},{"actualValue":70642.4,"brandName":"吉利","carName":"缤瑞","ecdemicVehicleFlag":"1","exhaustCapacity":1398,"fuelType":"0","hyModelCode":"CJLHBDUD0013","importFlag":"国产车","marketDate":"202004","noticeType":"MR7142D20","powerTypeCode":"D1","purchasePrice":90800,"rbcode":"BRD1068ZJJ","seatCount":5,"vehicleJingyouDto":{"brandName":"吉利","familyName":"缤瑞","price":90800,"priceType":"01","vehicleCode":"BRD1068ZJJ","vehicleName":"吉利美日MR7142D20轿车"},"vehicleStyleDesc":"CVT 亚运版 国Ⅵ","vehicleTonnage":0,"vehicleWeight":1360},{"actualValue":70642.4,"brandName":"吉利","carName":"缤瑞","ecdemicVehicleFlag":"1","exhaustCapacity":1398,"fuelType":"0","hyModelCode":"BJLHBDUC0005","importFlag":"国产车","marketDate":"202004","noticeType":"MR7142D20","powerTypeCode":"D1","purchasePrice":90800,"rbcode":"BRD1068ZJJ","seatCount":5,"vehicleJingyouDto":{"brandName":"吉利","familyName":"缤瑞","price":90800,"priceType":"01","vehicleCode":"BRD1068ZJJ","vehicleName":"吉利美日MR7142D20轿车"},"vehicleStyleDesc":"CVT 亚运版 国Ⅵ","vehicleTonnage":0,"vehicleWeight":1360}]}';

    $response = $IDock->vehicleModel($shortName, $vehicleModelVisitor);

    if (!$response->isSuccess()) {
        var_dump($response->getError());
    } else {
        var_dump($response->printer);
    }
    exit;
}

$vehiclePrice = '109044.8';
//报价
if (0) {
    /**
     * 询价主信息
     */
    $premiumInquiryVisitor = new PremiumInquiryVisitor();
    //商业险起保日期
    $premiumInquiryVisitor->biStartData = $biStartData;
    //商业险终保日期
    $premiumInquiryVisitor->biEndData = $biEndData;
    //交强险起保日期
    $premiumInquiryVisitor->ciStartData = $ciStartData;
    //交强险终保日期
    $premiumInquiryVisitor->ciEndData = $ciEndData;
    //商业险即时生效
    $premiumInquiryVisitor->biEffectFlag = false;
    //交强险即时生效
    $premiumInquiryVisitor->ciEffectFlag = false;

    $premiumInquiryVisitor->isNewEnergy = false;

    /**
     * 车辆信息
     */
    $premiumVehicleVisitor = new PremiumVehicleVisitor();
    //是否新车
    $premiumVehicleVisitor->isNewVehicle = '0';
    //车架号
    $premiumVehicleVisitor->vin = $vin;
    //发动机号
    $premiumVehicleVisitor->engineNo = $engineNo;
    //车牌号
    $premiumVehicleVisitor->licenseNo = $licenseNo;
    //初登时间
    $premiumVehicleVisitor->firstRegisterDate = $firstRegisterDate;
    //过户时间
    $premiumVehicleVisitor->transferDate = '';
    //是否过户车
    $premiumVehicleVisitor->isTransfer = '';
    //发证时间
    $premiumVehicleVisitor->issueDate = '';
    //车型编码
    $premiumVehicleVisitor->vehicleModel = $vehicleModel;
    //车型编码代码
    $premiumVehicleVisitor->vehicleModelCode = 'LKD1003ZJH'; //rbcode

    //车型名称
    $premiumVehicleVisitor->vehicleName = '领克JL6453C10多用途乘用车';
    //车价
    $premiumVehicleVisitor->vehiclePrice = '168800';
    //车价含税
    $premiumVehicleVisitor->vehiclePriceTax = '168800';
    //协商价格
    $premiumVehicleVisitor->actualValue = $vehiclePrice;
    //座位数
    $premiumVehicleVisitor->vehicleSeat = '5';
    //使用性质
    $premiumVehicleVisitor->useNatureCode = '01';
    //所属性质
    $premiumVehicleVisitor->attachNature = '01';
    //车辆用途
    $premiumVehicleVisitor->causeType = '001';
    //车辆种类
    $premiumVehicleVisitor->carKindCode = '100';
    //能源类型代码
    $premiumVehicleVisitor->energyTypeCode = 'E01';
    //号牌颜色代码
    $premiumVehicleVisitor->licenseColorCode = '01';
    //号牌种类代码
    $premiumVehicleVisitor->licenseTypeCode = '02';
    //交管车辆类型代码
    $premiumVehicleVisitor->vehicleStyleCode = 'K33';
    //功率
    $premiumVehicleVisitor->power = '';
    //排量
    $premiumVehicleVisitor->vehicleExhaust = '1.969';
    //整备质量
    $premiumVehicleVisitor->wholeWeight = '1632';
    //荷载质量
    $premiumVehicleVisitor->vehicleTonnage = '0.0';
    //进口标识
    $premiumVehicleVisitor->vehicleImport = 'I2';
    //是否能源车
    $premiumVehicleVisitor->isNewEnergy = '0';
    //纯电续航里程(公里)
    $premiumVehicleVisitor->pureRange = '';
    //车辆来历凭证编号
    $premiumVehicleVisitor->carCertificateNo = '';
    //开具车辆来历凭证所载日期
    $premiumVehicleVisitor->carCertificateDate = '';
    //车辆来历凭证种类代码
    $premiumVehicleVisitor->carCertificateType = '';


    $premiumVehicleVisitor->argc['actualValue'] = $vehiclePrice;
    $premiumVehicleVisitor->argc['brandName'] = '领克';
    $premiumVehicleVisitor->argc['hyModelCode'] = 'BLKFLAUD0003';
    $premiumVehicleVisitor->argc['noticeType'] = 'JL6453C10';
    $premiumVehicleVisitor->argc['vehicleJY'] = [
        'brandName' => '领克',
        'familyName' => '领克01',
        'price' => '168800',
        'priceType' => '01',
        'vehicleCode' => 'LKD1003ZJH',
        'vehicleName' => '领克JL6453C10多用途乘用车',
    ];

    /**
     * 关系人
     */
    $premiumRelationVisitor = new PremiumRelationVisitor();
    //姓名
    $premiumRelationVisitor->name = '许利锋';
    //联系方式
    $premiumRelationVisitor->mobile = '18215626530';
    //类型
    $premiumRelationVisitor->typeCode = 'R1';
    //证件类型
    $premiumRelationVisitor->certificateTypeCode = '01';
    //证件号码
    $premiumRelationVisitor->certificateNo = '51070419770206075X';
    //地址
    $premiumRelationVisitor->address = '四川省成都市龙泉驿区龙泉车城西一路185号1栋1单元20楼2001号';
    //邮箱
    $premiumRelationVisitor->email = '18982272991@qq.com';
    //证件有效期
    $premiumRelationVisitor->certificateStartDate = '2000-01-01';
    //证件失效期
    $premiumRelationVisitor->certificateEndDate = '2050-01-01';
    $premiumRelationVisitor->provinceCode = '510000';
    $premiumRelationVisitor->cityCode = '510100';
    $premiumRelationVisitor->areaCode = '510105';

    /**
     * 缴税信息
     */
    $premiumCarTaxVisitor = new PremiumCarTaxVisitor();
    //缴税内心
    $premiumCarTaxVisitor->taxTypeCode = 'T01';
    //纳税人姓名
    $premiumCarTaxVisitor->taxpayerName = '蒲文浩';
    //纳税人证件类型
    $premiumCarTaxVisitor->taxpayerCertificateTypeCode = '01';
    //纳税人证件号码
    $premiumCarTaxVisitor->taxpayerCertificateNo = '511322198711095918';
    //纳税人电话
    $premiumCarTaxVisitor->taxpayerPhone = '18215626530';
    //纳税起期
    $premiumCarTaxVisitor->taxStartDate = '';
    //纳税止期
    $premiumCarTaxVisitor->taxEndDate = '';
    //减免税方案代码
    $premiumCarTaxVisitor->taxReductionCode = '';
    //减免税原因代码
    $premiumCarTaxVisitor->taxReductionReasonCode = '';
    //税务机关名称
    $premiumCarTaxVisitor->taxDepartment = '';
    //税务机关代码
    $premiumCarTaxVisitor->taxDepartmentCode = '';
    //开具完税凭证地区代码
    $premiumCarTaxVisitor->taxPaidAreaCode = '';
    //完税凭证填发日期
    $premiumCarTaxVisitor->taxDocumentDate = '';
    //减免比例 百分比
    $premiumCarTaxVisitor->taxFreeRate = '';
    //减税金额 元
    $premiumCarTaxVisitor->taxExemption = '';
    //减免完税凭证号
    $premiumCarTaxVisitor->taxDocumentNumber = '';

    //险种
    $premiumCoverageVisitor = new PremiumCoverageVisitor();
    $premiumCoverageVisitor->coverageCode = 'C04001';
    $premiumCoverageVisitor->amount = '10000';
    $premiumInquiryVisitor->coverageVisitorAppend($premiumCoverageVisitor);

    //
    $premiumCoverageVisitor1 = new PremiumCoverageVisitor();
    $premiumCoverageVisitor1->coverageCode = 'C05001';
    $premiumCoverageVisitor1->amount = '40000';
    $premiumCoverageVisitor1->unitAmount = '10000';
    $premiumCoverageVisitor1->quantity = '4';
    $premiumInquiryVisitor->coverageVisitorAppend($premiumCoverageVisitor1);

    //
    $premiumCoverageVisitor2 = new PremiumCoverageVisitor();
    $premiumCoverageVisitor2->coverageCode = 'C03001';
    $premiumCoverageVisitor2->amount = '1000000';
    $premiumInquiryVisitor->coverageVisitorAppend($premiumCoverageVisitor2);

    $premiumCoverageVisitor3 = new PremiumCoverageVisitor();
    $premiumCoverageVisitor3->coverageCode = 'C02001';
    $premiumCoverageVisitor3->amount = $vehiclePrice;
    $premiumInquiryVisitor->coverageVisitorAppend($premiumCoverageVisitor3);

    //险种添加


    //新能源充电桩信息
    $premiumChargingPileVisitor = new PremiumChargingPileVisitor();
    //
    //$premiumChargingPileVisitor->seqNo = '1';
    ////充电桩类型
    //$premiumChargingPileVisitor->chargingPileKind = 'PK1';
    ////充电桩安装地点类型
    //$premiumChargingPileVisitor->chargingPileAddressType = 'PA1';
    ////充电桩使用年限
    //$premiumChargingPileVisitor->chargingPileYearLimit = 'PY1';
    ////充电桩编码
    //$premiumChargingPileVisitor->chargingPileCode = '123456';
    ////充电桩型号
    //$premiumChargingPileVisitor->chargingPileType = 'BCS100500';
    ////充电桩地址
    //$premiumChargingPileVisitor->chargingPileAddress = '地面充电桩';
    ////损失保险保额
    //$premiumChargingPileVisitor->lossAmount = '';
    ////责任保险保额
    //$premiumChargingPileVisitor->liabilityAmount = '10000';

    /**
     * 拓展信息
     */
    $premiumExtInfoVisitor = new PremiumExtInfoVisitor();
    //验车情况
    $premiumExtInfoVisitor->carCheckCode = '';
    //免验原因
    $premiumExtInfoVisitor->carCheckReasonKind = '';
    //验车人
    $premiumExtInfoVisitor->carChecker = '';
    //验车日期
    $premiumExtInfoVisitor->carCheckDate = '';
    //验车地点
    $premiumExtInfoVisitor->carAddress = '';
    //是否送修
    $premiumExtInfoVisitor->isMonopoly = '';
    //送修代码
    $premiumExtInfoVisitor->repairCode = '';
    //送修名称
    $premiumExtInfoVisitor->repairName = '';
    //自主定价系数
    $premiumExtInfoVisitor->selfPricingFactor = '';
    //自主核保系数
    $premiumExtInfoVisitor->underwritingFactor = '';
    //期望折扣
    $premiumExtInfoVisitor->expectedDiscount = '';
    //是否贷款车
    $premiumExtInfoVisitor->isLoanCar = '';
    //贷款机构名称
    $premiumExtInfoVisitor->loanOrg = '';

    //天安拓展
    $premiumExtInfoVisitor->argc['cityCode'] = $cityCode;
    $premiumExtInfoVisitor->argc['businessNature'] = '23'; //业务来源
    $premiumExtInfoVisitor->argc['companyCode'] = '0150313231'; //归属部门代码
    //$premiumExtInfoVisitor->argc['teamCode'] = '015031T286'; //团队代码
    $premiumExtInfoVisitor->argc['salesmanCode'] = '015031A10207'; //业务员代码
    $premiumExtInfoVisitor->argc['salesmanName'] = '沈玉洁'; //业务员姓名
    //$premiumExtInfoVisitor->argc['intermediaryCode'] = '015031B00360'; //中介代码
    //$premiumExtInfoVisitor->argc['intermediaryCode'] = '015031B00451';
    $premiumExtInfoVisitor->argc['intermediaryCode'] = '018330B00016';

    //$premiumExtInfoVisitor->argc['netServiceCode'] = '015031H10585'; //网点服务代码

    //添加车辆信息
    $premiumInquiryVisitor->setVehicleVisitor($premiumVehicleVisitor);
    //添加投保人
    $premiumInquiryVisitor->setApplicantVisitor($premiumRelationVisitor);
    //添加被保人
    $premiumInquiryVisitor->setInsuredVisitor($premiumRelationVisitor);
    //添加车主
    $premiumInquiryVisitor->setOwnerVisitor($premiumRelationVisitor);
    //车船税
    $premiumInquiryVisitor->setCarTaxVisitor($premiumCarTaxVisitor);

    //新能源充电桩
    $premiumInquiryVisitor->chargingPileVisitorAppend($premiumChargingPileVisitor);
    //拓展信息
    $premiumInquiryVisitor->setExtInfoVisitor($premiumExtInfoVisitor);

    //非车
    $nonCarInquiryVisitor = new  NonCarInquiryVisitor();
    $premiumInquiryVisitor->setNonCarInquiryVisitor($nonCarInquiryVisitor);

    //询价
    if (0) {
        //$testResponse = '{"responseCode":"0","responseMsg":"失败","errorCode":"2006","errorMsg":"token expired","responseTime":"2023-11-08 09:50:21","processId":"4474741f3d4d78a4","result":{"data":{"records":[{"info":"token已经失效,请使用最新token"}]}}}';
        $testResponse = '{"actualValue":74300.8,"bizClaimAdjustLevel":"","bizClaimadjustreason":"","bizNonClaimAdjustReason":"","bizPeccancyAdjustReason":"","bizPremfactor1":"1.0","bizPremfactor4":"1.0","busRenewalFlag":"N","carPremiumCaculateNo":"130888502024040700000562","claimAdjust":0,"claimadjustreason":"","combineProductList":[{"allRuleInfo":{"commercePolicyPremium":88.33,"commerceSuggestPremium":0,"compulsoryPolicyPremium":0,"compulsorySuggestPremium":0,"entireCostDiscount":0,"entireCostRate":0,"entireRecommenDiscount":0,"feeCtrlDtoBodyRes":[],"fixRatio":0,"forecastLossRation":0,"gsRulesMainDtos":[{"calculationBasis":"N","commissionVatType":"1","costPercent":0,"costRuleId":"","dealType":"201","deferPercent":0,"feeType":"201","orgValue":"0","riskCode":"0895","ruleId":"","ruleValue1":"0","ruleValue4":"0.0","ruleValue5":"0.0","salesState":"0","shortPercent":0,"taxRate":0.01,"topCommission":50,"topPercent":0,"topRuleId":"","topSumPercent":0},{"costPercent":0,"costRuleId":"","dealType":"R31","deferPercent":0,"feeType":"R31","orgValue":"0","riskCode":"0895","ruleId":"","ruleValue1":"0","ruleValue4":"0.0","ruleValue5":"0.0","salesState":"0","shortPercent":0,"topCommission":0,"topPercent":0,"topRuleId":"","topSumPercent":0},{"costPercent":0,"costRuleId":"","dealType":"R32","deferPercent":0,"feeType":"R32","orgValue":"0","riskCode":"0895","ruleId":"","ruleValue1":"0","ruleValue4":"0.0","ruleValue5":"0.0","salesState":"0","shortPercent":0,"topCommission":0,"topPercent":0,"topRuleId":"","topSumPercent":0},{"costPercent":0,"costRuleId":"","dealType":"R33","deferPercent":0,"feeType":"R33","orgValue":"0","riskCode":"0895","ruleId":"","ruleValue1":"0","ruleValue4":"0.0","ruleValue5":"0.0","salesState":"0","shortPercent":0,"topCommission":0,"topPercent":0,"topRuleId":"","topSumPercent":0},{"costPercent":0,"costRuleId":"","dealType":"R41","deferPercent":0,"feeType":"R41","orgValue":"0","riskCode":"0895","ruleId":"","ruleValue1":"0","ruleValue4":"0.0","ruleValue5":"0.0","salesState":"0","shortPercent":0,"topCommission":0,"topPercent":0,"topRuleId":"","topSumPercent":0},{"costPercent":0,"costRuleId":"","dealType":"R42","deferPercent":0,"feeType":"R42","orgValue":"0","riskCode":"0895","ruleId":"","ruleValue1":"0","ruleValue4":"0.0","ruleValue5":"0.0","salesState":"0","shortPercent":0,"topCommission":0,"topPercent":0,"topRuleId":"","topSumPercent":0},{"costPercent":0,"costRuleId":"","dealType":"2","deferPercent":0,"feeType":"2","orgValue":"0","riskCode":"0895","ruleId":"","ruleValue1":"0","ruleValue4":"0.0","ruleValue5":"0.0","salesState":"0","shortPercent":0,"topCommission":0,"topPercent":0,"topRuleId":"","topSumPercent":0},{"costPercent":0,"costRuleId":"","dealType":"R39","deferPercent":0,"feeType":"R39","orgValue":"0","riskCode":"0895","ruleId":"","ruleValue1":"0","ruleValue4":"0.0","ruleValue5":"0.0","salesState":"0","shortPercent":0,"topCommission":0,"topPercent":0,"topRuleId":"","topSumPercent":0},{"costPercent":0,"costRuleId":"","dealType":"S01","deferPercent":0,"feeType":"S01","orgValue":"0","riskCode":"0895","ruleId":"","ruleValue1":"0","ruleValue4":"0.0","ruleValue5":"0.0","salesState":"0","shortPercent":0,"topCommission":0,"topPercent":0,"topRuleId":"","topSumPercent":0},{"costPercent":0,"costRuleId":"","dealType":"R51","deferPercent":0,"feeType":"R51","orgValue":"0","riskCode":"0895","ruleId":"","ruleValue1":"0","ruleValue4":"0.0","ruleValue5":"0.0","salesState":"0","shortPercent":0,"topCommission":0,"topPercent":0,"topRuleId":"","topSumPercent":0}],"hsActuarialCostsJq":0,"hsActuarialCostsSc":0,"hsAmountOfProfit":0,"hsApInfos":[],"hsChannelFactor":0,"hsComplementaryValues":0,"hsExpectedCostRateJq":" ","hsExpectedCostRateSc":" ","hsPersonFactor":0,"hsPureRiskPremiumJq":0,"hsPureRiskPremiumSc":0,"hsRuleDiscount":0,"hsSigningDiscount":0,"hxActlossratioAll":0,"hxBasePremB":0,"hxConfigCostRate":0,"hxCostRate":0,"hxCostRateCom":0,"hxCtplSaleRate":0,"hxCurrentPremiumCom":83.33,"hxCurrentPremiumCtp":0,"hxDeductionRatio":0,"hxDiscountRatio":0,"hxExceptiondiscount":0,"hxFinaldiscountRatio":0.5,"hxGovDiscTop":0,"hxGovDiscount":0,"hxNoSalePrem":0,"hxReparationsRate":0,"hxRewardRatio":0,"hxSaleFeeCom":0,"hxSaleFeeCtp":0,"hxSaleRateAll":0,"hxSaleRateAllJq":0,"hxSaleRateCtp":0,"hxSuggestPremiumCom":0,"hxSuggestPremiumCtp":0,"hxSuggestPremiumMnCtp":0,"hxTotCostRate":0,"hxfjSaleRateCom":0,"hxjfSaleRateCom":0,"policySumRatio":0,"premcoefInfoDtos":[{"premfactor1":1,"premfactor2":0,"premfactor3":0,"premfactor4":1,"premfactorPrice":0.5}],"premiumDtos":[{"basePremium":45,"deductibleRate":0,"kindCode":"0895001","oldPayStandardPremium":0,"payStandardPremium":30,"rate":9,"serialNo":"0","shortRateStandardPremium":60,"standardPremium":60,"suggestPremium":0,"sumDiscount":0.5},{"basePremium":87.5,"deductibleRate":0,"kindCode":"0895002","oldPayStandardPremium":0,"payStandardPremium":58.33,"rate":17.5,"serialNo":"1","shortRateStandardPremium":116.666667,"standardPremium":116.666667,"suggestPremium":0,"sumDiscount":0.5}],"rateVersion":"","returnType":"1","shortRatio":1,"sumPolicyPremium":0,"sumSuggestPremium":0,"tax":0,"taxItemNo":"","taxUnitFlag":"M","totCostRateJl":0,"totCostRateJq":0,"totSaleFee":0,"tradeCode":"96f0f80bd525401f840cf5db91151697","upperFeeRateSy":0,"wholePrePayRateAll":0},"engageDTOList":[{"formCode":"t0555001","formContent":"本保单保险费为含税金额，其中不含税保险费83.33元、增值税5.00元。","formName":"费税特约","readonlyInd":"1","speAgreDetl":"N"},{"formCode":"t0050002","formContent":"尊敬的客户，为保障您的利益，请在收到保单一周内拨打我公司24小时服务热线95505核实保险单资料。","formName":"信息查询-2","readonlyInd":"2","speAgreDetl":"N"},{"formCode":"t0050001","formContent":"本保单的承保理赔信息可通过登陆www.tianan-insurance.com、致电95505或直接在营业网点查询。若对查询结果有异议，可通过网上留言或致电95505投诉。","formName":"信息查询-1","readonlyInd":"1","speAgreDetl":"N"}],"policyCoverages":[{"discountDetail":[{"condition":"","discountCode":"premfactor1","discountName":"无赔款优待系数","discountRate":1},{"condition":"","discountCode":"premfactor2","discountName":"自主渠道系数","discountRate":0},{"condition":"","discountCode":"premfactor3","discountName":"自主核保系数","discountRate":0},{"condition":"","discountCode":"premfactor4","discountName":"交通违法系数","discountRate":1},{"condition":"","discountCode":"premfactorPrice","discountName":"自主定价系数","discountRate":0.5}],"duePremium":30,"kindCode":"0895001","kindInd":"1","premiumExclud":28.3,"premiumRate":9,"stPremium":60,"sumInsured":100000,"taxAmtExclud":1.7,"totalFloatRate":0.5},{"discountDetail":[{"condition":"","discountCode":"premfactor1","discountName":"无赔款优待系数","discountRate":1},{"condition":"","discountCode":"premfactor2","discountName":"自主渠道系数","discountRate":0},{"condition":"","discountCode":"premfactor3","discountName":"自主核保系数","discountRate":0},{"condition":"","discountCode":"premfactor4","discountName":"交通违法系数","discountRate":1},{"condition":"","discountCode":"premfactorPrice","discountName":"自主定价系数","discountRate":0.5}],"duePremium":58.33,"kindCode":"0895002","kindInd":"1","premiumExclud":55.03,"premiumRate":17.5,"stPremium":116.666667,"sumInsured":200000,"taxAmtExclud":3.3,"totalFloatRate":0.5}],"productCode":"0895","sumAmount":1500000,"sumPremium":88.33}],"combosList":[{"comboNo":"BUSINESS","costRateTranche":"0","elrLevelAll":"d3","elrLevelCOM":"d3","elrLevelCTP":"d3","engageList":[{"engageCode":"t0555001","engageContent":"本保单保险费为含税金额，其中不含税保险费1510.34元、增值税90.62元。","engageTitle":"费税特约","speAgreDetl":"N"},{"engageCode":"t0270001","engageContent":"保险期间内，如发生本保险合同约定的保险事故造成被保险车辆损失或第三者财产损失，保险人可采取实物或修复方式进行保险赔付。","engageTitle":"实物抵扣","speAgreDetl":"N"},{"engageCode":"t0050009","engageContent":"感谢您选择投保天安财险，我司承诺您可尊享公司线上快捷理赔、爱车4S店直赔、维修品质检验、重大事故陪同、医药垫付通道五大金牌服务，具体相关服务内容欢迎拨打我司服务热线95505咨询或登录“天安财险”公众号查看。","engageTitle":"信息查询-9","speAgreDetl":"N"},{"engageCode":"t0050003","engageContent":"保险人实行全年昼夜案件受理服务，接到报案后及时进行事故处理。报案电话：95505。","engageTitle":"信息查询-3","speAgreDetl":"N"},{"engageCode":"t0050001","engageContent":"本保单的承保理赔信息可通过登陆www.tianan-insurance.com、致电95505或直接在营业网点查询。若对查询结果有异议，可通过网上留言或致电95505投诉。","engageTitle":"信息查询-1","speAgreDetl":"N"}],"entireRecommenDiscount":0,"feeDiscountSwitch":"0","feeDisctJqTSwitch":"0","fjFeeDisctSwitch":"0","itemKindList":[{"adjustRate":0,"amount":2000000,"basePremium":832.666667,"benchMarkPremium":832.666667,"deductableFlag":"0","deductible":0,"deductibleRate":0,"discount":50,"discountPremium":416.33,"grossPremium":0,"itemCode":"","itemDetailName":"","itemNo":0,"kindCode":"02","kindName":"第三者责任保险","modeCode":"","modeName":"","netPremium":0,"optionalFlag":"","premium":416.33,"premiumExclud":392.76,"quantity":0,"rate":0,"riskCode":"","shortRate":"","unitAmount":0,"unitInsured":0},{"adjustRate":0,"amount":10000,"basePremium":28.293333,"benchMarkPremium":28.293333,"deductableFlag":"0","deductible":0,"deductibleRate":0,"discount":50,"discountPremium":14.15,"grossPremium":0,"itemCode":"","itemDetailName":"","itemNo":0,"kindCode":"041","kindName":"车上人员责任保险（司机）","modeCode":"","modeName":"","netPremium":0,"optionalFlag":"","premium":14.15,"premiumExclud":13.35,"quantity":0,"rate":0.21,"riskCode":"","shortRate":"","unitAmount":0,"unitInsured":0},{"adjustRate":0,"amount":40000,"basePremium":71.786667,"benchMarkPremium":71.786667,"deductableFlag":"0","deductible":0,"deductibleRate":0,"discount":50,"discountPremium":35.89,"grossPremium":0,"itemCode":"","itemDetailName":"","itemNo":0,"kindCode":"044","kindName":"车上人员责任保险（乘客）","modeCode":"","modeName":"","netPremium":0,"optionalFlag":"","premium":35.89,"premiumExclud":33.86,"quantity":4,"rate":0.13,"riskCode":"","shortRate":"","unitAmount":10000,"unitInsured":0},{"adjustRate":0,"amount":74300.8,"basePremium":2269.174667,"benchMarkPremium":2269.174667,"deductableFlag":"0","deductible":0,"deductibleRate":0,"discount":50,"discountPremium":1134.59,"grossPremium":0,"itemCode":"","itemDetailName":"","itemNo":0,"kindCode":"01","kindName":"机动车损失保险","modeCode":"","modeName":"","netPremium":0,"optionalFlag":"","premium":1134.59,"premiumExclud":1070.37,"quantity":0,"rate":100,"riskCode":"","shortRate":"","unitAmount":0,"unitInsured":0}],"premiumChange":0,"priceFeeDto":{"entireCostRate":0,"fixRatio":0,"hsActuarialCostsJQ":0,"hsActuarialCostsSC":0,"hsAmountOfProfit":0,"hsChannelFactor":0,"hsComplementaryValues":0,"hsPersonFactor":0,"hsPureRiskPremiumJQ":1116.98,"hsPureRiskPremiumSC":1930.84,"hsSigningDiscount":0.5,"hxActlossratioAll":0,"hxBasePremB":0,"hxConfigCostRate":0,"hxCostRate":0,"hxCostRateCOM":0,"hxCtplSaleRate":0,"hxCurrentPremiumCOM":1510.34,"hxCurrentPremiumCTP":0,"hxDeductionRatio":0,"hxDiscountRatio":0,"hxExceptionDiscount":0,"hxFinalDiscountRatio":0.5,"hxGovDiscOunt":0.5,"hxGovDiscTop":1.5,"hxNoSalePrem":0,"hxReparationsRate":0,"hxRewardRatio":0,"hxSaleFeeCOM":0,"hxSaleFeeCTP":0,"hxSaleRateAll":0,"hxSaleRateAllTJQ":0,"hxSaleRateCOM":0,"hxSaleRateCTP":0,"hxSuggestPremiumCOM":0,"hxSuggestPremiumCTP":0,"hxSuggestPremiumMNCTP":0,"hxTotCostRate":0,"totCostRateJL":0,"totCostRateJQ":0,"totSaleFee":0,"upperFeeRateSY":0},"quotationBINo":"230888502024040700000564","returnType":"1","riskCode":"","rnTrafficCountCTP":0,"rnYears":0,"serialNo":"","sumAmount":2124300.8,"sumBenchMarkPremium":3201.921334,"sumDiscount":50,"sumDiscountPremium":0,"sumPremium":1600.96,"sumSubPremium":0,"tianMaIndexBasicPrice":36.9964,"tianMaIndexFloorPrice":27.3042,"wholePrePayRateBasicPrice":0.7781,"wholePrePayRateFloorPrice":1.2665},{"comboNo":"JQXCOMBO001","costRateTranche":"0","elrLevelAll":"d2","elrLevelCOM":"","elrLevelCTP":"d2","engageList":[{"engageCode":"t0050009","engageContent":"感谢您选择投保天安财险，我司承诺您可尊享公司线上快捷理赔、爱车4S店直赔、维修品质检验、重大事故陪同、医药垫付通道五大金牌服务，具体相关服务内容欢迎拨打我司服务热线95505咨询或登录“天安财险”公众号查看。","engageTitle":"信息查询-9","speAgreDetl":"N"},{"engageCode":"t0270001","engageContent":"保险期间内，如发生本保险合同约定的保险事故造成被保险车辆损失或第三者财产损失，保险人可采取实物或修复方式进行保险赔付。","engageTitle":"实物抵扣","speAgreDetl":"N"},{"engageCode":"t0555001","engageContent":"本保单保险费为含税金额，其中不含税保险费896.23元、增值税53.77元。","engageTitle":"费税特约","speAgreDetl":"N"},{"engageCode":"t0050003","engageContent":"保险人实行全年昼夜案件受理服务，接到报案后及时进行事故处理。报案电话：95505。","engageTitle":"信息查询-3","speAgreDetl":"N"}],"entireRecommenDiscount":0,"feeDiscountSwitch":"0","feeDisctJqTSwitch":"0","fjFeeDisctSwitch":"0","itemKindList":[{"adjustRate":0,"amount":200000,"basePremium":950,"benchMarkPremium":950,"deductableFlag":"0","deductible":0,"deductibleRate":0,"discount":100,"discountPremium":950,"grossPremium":0,"itemCode":"","itemDetailName":"","itemNo":0,"kindCode":"BZ","kindName":"机动车交通事故责任强制险","modeCode":"","modeName":"","netPremium":0,"optionalFlag":"","premium":950,"premiumExclud":896.3,"quantity":0,"rate":0,"riskCode":"","shortRate":"","unitAmount":0,"unitInsured":0}],"priceFeeDto":{"entireCostRate":0,"fixRatio":0,"hsActuarialCostsJQ":0,"hsActuarialCostsSC":0,"hsAmountOfProfit":0,"hsChannelFactor":0,"hsComplementaryValues":0,"hsPersonFactor":0,"hsPureRiskPremiumJQ":889.47,"hsPureRiskPremiumSC":0,"hsSigningDiscount":0,"hxActlossratioAll":0,"hxBasePremB":0,"hxConfigCostRate":0,"hxCostRate":0,"hxCostRateCOM":0,"hxCtplSaleRate":0,"hxCurrentPremiumCOM":0,"hxCurrentPremiumCTP":0,"hxDeductionRatio":0,"hxDiscountRatio":0,"hxExceptionDiscount":0,"hxFinalDiscountRatio":0,"hxGovDiscOunt":0.5,"hxGovDiscTop":1.5,"hxNoSalePrem":0,"hxReparationsRate":0,"hxRewardRatio":0,"hxSaleFeeCOM":0,"hxSaleFeeCTP":0,"hxSaleRateAll":0,"hxSaleRateAllTJQ":0,"hxSaleRateCOM":0,"hxSaleRateCTP":0,"hxSuggestPremiumCOM":0,"hxSuggestPremiumCTP":0,"hxSuggestPremiumMNCTP":0,"hxTotCostRate":0,"totCostRateJL":0,"totCostRateJQ":0,"totSaleFee":0,"upperFeeRateSY":0},"quotationCINo":"230881502024040700000563","returnType":"1","riskCode":"","rnTrafficCountCTP":0,"rnYears":0,"serialNo":"","sumAmount":200000,"sumBenchMarkPremium":950,"sumDiscount":100,"sumDiscountPremium":0,"sumPremium":950,"sumSubPremium":0,"tianMaIndexBasicPrice":24.831,"tianMaIndexFloorPrice":38.0311,"wholePrePayRateBasicPrice":0.9925,"wholePrePayRateFloorPrice":0.9925},{"comboNo":"JYXCOMBO","engageList":[{"engageCode":"t0555001","engageContent":"本保单保险费为含税金额，其中不含税保险费83.33元、增值税5.00元。","engageTitle":"费税特约","speAgreDetl":"N"},{"engageCode":"t0050002","engageContent":"尊敬的客户，为保障您的利益，请在收到保单一周内拨打我公司24小时服务热线95505核实保险单资料。","engageTitle":"信息查询-2","speAgreDetl":"N"},{"engageCode":"t0050001","engageContent":"本保单的承保理赔信息可通过登陆www.tianan-insurance.com、致电95505或直接在营业网点查询。若对查询结果有异议，可通过网上留言或致电95505投诉。","engageTitle":"信息查询-1","speAgreDetl":"N"}],"entireRecommenDiscount":0,"itemKindList":[{"adjustRate":0,"amount":100000,"basePremium":60,"benchMarkPremium":60,"deductible":0,"deductibleRate":0,"discount":50,"discountPremium":30,"grossPremium":0,"itemCode":"","itemDetailName":"","itemNo":0,"kindCode":"0895001","kindName":"驾乘人员意外伤害保险","modeCode":"","modeName":"","netPremium":0,"optionalFlag":"","premium":30,"quantity":0,"rate":900,"riskCode":"","unitAmount":0,"unitInsured":0},{"adjustRate":0,"amount":200000,"basePremium":116.666667,"benchMarkPremium":116.666667,"deductible":0,"deductibleRate":0,"discount":50,"discountPremium":58.33,"grossPremium":0,"itemCode":"","itemDetailName":"","itemNo":0,"kindCode":"0895002","kindName":"驾乘人员意外伤害医疗保险","modeCode":"","modeName":"","netPremium":0,"optionalFlag":"","premium":58.33,"quantity":0,"rate":1750,"riskCode":"","unitAmount":0,"unitInsured":0}],"priceFeeDto":{"entireCostRate":0,"fixRatio":0,"hsActuarialCostsJQ":0,"hsActuarialCostsSC":0,"hsAmountOfProfit":0,"hsChannelFactor":0,"hsComplementaryValues":0,"hsPersonFactor":0,"hsPureRiskPremiumJQ":0,"hsPureRiskPremiumSC":0,"hsSigningDiscount":0,"hxActlossratioAll":0,"hxBasePremB":0,"hxConfigCostRate":0,"hxCostRate":0,"hxCostRateCOM":0,"hxCtplSaleRate":0,"hxCurrentPremiumCOM":83.33,"hxCurrentPremiumCTP":0,"hxDeductionRatio":0,"hxDiscountRatio":0,"hxExceptionDiscount":0,"hxFinalDiscountRatio":0.5,"hxGovDiscOunt":0,"hxGovDiscTop":0,"hxNoSalePrem":0,"hxReparationsRate":0,"hxRewardRatio":0,"hxSaleFeeCOM":0,"hxSaleFeeCTP":0,"hxSaleRateAll":0,"hxSaleRateAllTJQ":0,"hxSaleRateCOM":0,"hxSaleRateCTP":0,"hxSuggestPremiumCOM":0,"hxSuggestPremiumCTP":0,"hxSuggestPremiumMNCTP":0,"hxTotCostRate":0,"totCostRateJL":0,"totCostRateJQ":0,"totSaleFee":0,"upperFeeRateSY":0},"riskCode":"","serialNo":"","sumAmount":1500000,"sumBenchMarkPremium":88.33,"sumDiscount":0,"sumDiscountPremium":0,"sumPremium":88.33,"sumSubPremium":0}],"commercialNum":0,"ctpClaimadjustreason":"","ctpPeccancyAdjustReason":"","ctpPremfactor1":"1.0","ctpPremfactor4":"1.0","dealFlag":"1","dealMessage":"套餐精确报价成功！","endDate":"2025-04-07","endDateBus":"2025-04-07","forceRenewalFlag":"N","insuredStatus":"2","noclaimadjustreason":"","paymentMode":"2","pcCarShipTaxInfoDto":{"deductionProportion":0,"lateFee":0,"previousPay":0,"sumTax":300,"taxActual":300,"taxEndDate":"2024-12-31","taxStartDate":"2024-01-01"},"peccancyAdjust":0,"preUnderWritingDTO":{"puwFlag":"00"},"premfactor1":"1.0","premfactor2":"0.0","premfactor3":"0.0","premfactor4":"1.0","premfactorPrice":"0.5","premiumType":"1","purchasePrice":149800,"renewalCarFlag":"0","resultDTO":{"resultCode":"SUCCESS","resultMess":"统一平台调用成功"},"rnTrafficCountCTP":0,"rnYears":0,"rulePreundwrt":{"tianMaIndexUndwrt":36.9964,"uwCommonParam":{"coreNetServiceCode":"0","gbLuxuryVehicle":"0","selfBrandType":"","selfVehcType":"C","teamRiskLevel":""}},"seatCount":5,"startDate":"2024-04-08","startDateBus":"2024-04-08","tipsMessage":"","trafficInsuranceNum":0,"userYear":"7"}';

        $response = $IDock->premiumInquiry($shortName, $premiumInquiryVisitor);

        if (!$response->isSuccess()) {
            var_dump($response->printer);
        } else {
            /*** @var $printer PremiumInquiryPrinter; */
            $printer = $response->getPrinter();
            var_dump($printer->repeatInsurePrinter);
            var_dump($printer->ciPremiumPrinter);
            var_dump($printer->biPremiumPrinter);
            var_dump($printer->inquiryNo);
            var_dump($printer->argc['tradeNo']);
        }
        exit;
    }

    //核保
    if (1) {
        //影像资料上传
        //$premiumInquiryVisitor->fileAppend('10010', 'https://p0.itc.cn/q_70/images03/20220512/77ed76720a1f40ef94948761dda05655.jpeg');

        /**
         * 核保信息
         */
        $premiumUnderwritingVisitor = new PremiumUnderwritingVisitor();
        $premiumUnderwritingVisitor->inquiryNo = '130888502023120600000462';
        $premiumUnderwritingVisitor->biInquiryNo = '';
        $premiumUnderwritingVisitor->ciInquiryNo = '';
        $premiumInquiryVisitor->setNonCarUnderwritingVisitor($nonCarInquiryVisitor);
        //$premiumUnderwritingVisitor
        //$specialClauses = new SpecialClausesVisitor();
        //$specialClauses->clauseCode = 'T0048';
        //$specialClauses->clauseName = '非营业车辆特别约定';
        //$specialClauses->clauseContent = '非营业车辆因从事营业性运输而导致的事故，我公司不承担赔偿责任.';
        //$specialClauses->clauseType  = '0';
        //$specialClauses->riskType = 'VCI';
        //$specialClauses->autoFlag = '1';
        ////
        //$specialClauses2 = new SpecialClausesVisitor();
        //$specialClauses2->clauseCode = 'T0098';
        //$specialClauses2->clauseName = '偿付能力信息披露';
        //$specialClauses2->clauseContent = '都邦财产保险股份有限公司2019年3季度核心偿付能力充足率为197%,综合偿付能力充足率为197%,最近一季度风险综合评级为B。根据中国保险监督管理委员偿付能力监管规则规定，公司偿付能力充足率满足监管要求。';
        //$specialClauses2->clauseType  = '0';
        //$specialClauses2->riskType = 'VCI';
        //$specialClauses2->autoFlag = '0';
        //
        //$specialClauses3 = new SpecialClausesVisitor();
        //$specialClauses3->clauseCode = 'T0098';
        //$specialClauses3->clauseName = '偿付能力信息披露';
        //$specialClauses3->clauseContent = '都邦财产保险股份有限公司2019年3季度核心偿付能力充足率为197%,综合偿付能力充足率为197%,最近一季度风险综合评级为B。根据中国保险监督管理委员偿付能力监管规则规定，公司偿付能力充足率满足监管要求。';
        //$specialClauses3->clauseType  = '0';
        //$specialClauses3->riskType = 'TCI';
        //$specialClauses3->autoFlag = '0';
        //
        //$premiumUnderwritingVisitor->specialClausesAppend($specialClauses);
        //$premiumUnderwritingVisitor->specialClausesAppend($specialClauses2);
        //$premiumUnderwritingVisitor->specialClausesAppend($specialClauses3);
        //
        //
        $premiumInquiryVisitor->setUnderwritingVisitor($premiumUnderwritingVisitor);
        $premiumExtInfoVisitor->argc['tradeNo'] = '2023120614513128015';

        $premiumInquiryVisitor->setExtInfoVisitor($premiumExtInfoVisitor);

        //$testResponse = '{"responseCode":"1","responseMsg":"成功","errorCode":"0000","errorMsg":"success","responseTime":"2023-11-08 17:46:14","processId":"d84bdf20b827ebb8","result":{"data":{"records":[{"ifSuccess":"1","errorReason":"10510251010023000028提交核保成功！关联单:10590251010023000060提交核保也成功！","underWriteCode":"1","underWriteDesc":"转人工核保","proposalNoBI":"10510251010023000028","proposalNoCI":"10590251010023000060","vipFlag":"0","insuredCode":"80003196972","appliCode":"80003196972"}]}}}';
        //$testResponse = '{"busProposalNo":"0503132088820230000007","busUnderWriteFlag":"3","bzProposalNo":"0503132088120230000007","bzUnderWriteFlag":"3","cityCode":"3510001","companyCode":"0150313231","dealFlag":"1","dealMassage":"规则引擎：自动核保通过【1_不得配置个人激励费用】","evalLevel":"3","proposalNo":"0503132138820230000007","recoredResulteList":[],"resultDTO":{"resultCode":"SUCCESS","resultMess":"统一平台调用成功"}}';
        $testResponse = '{
	"busProposalNo": "0503132088820240021626",
	"busUnderWriteFlag": "9",
	"bzProposalNo": "0503132088120240023689",
	"bzUnderWriteFlag": "9",
	"cityCode": "3510001",
	"companyCode": "0150313231",
	"dealFlag": "1",
	"dealMassage": "规则引擎：转人工核保【1_家用车天马一二档业务转初核人工2_预测高赔付业务，转初核人工】",
	"evalLevel": "9",
	"proposalNo": "0503132138820240020971",
	"recoredResulteList": [],
	"resultDTO": {
		"resultCode": "SUCCESS",
		"resultMess": "统一平台调用成功"
	}
}';
        //核保
        $response = $IDock->underwriting($shortName, $premiumInquiryVisitor);

        if ($response->isSuccess()) {
            /*** @var $printer PremiumUnderwritingPrinter; */
            $printer = $response->getPrinter();
            var_dump($printer);
            var_dump($printer->inquiryNo);
            var_dump($printer->ciInquiryNo);
            var_dump($printer->biInquiryNo);
        } else {
            var_dump($response->getError());
        }

        exit;
    }
}

//支付
if (0) {

    $policyPaymentVisitor = new PolicyPaymentVisitor();
    $policyPaymentVisitor->inquiryNo = '0503132138820230000010';
    $policyPaymentVisitor->ciInquiryNo = '0503132088120230000010';
    $policyPaymentVisitor->biInquiryNo = '0503132088820230000010';

    $policyPaymentVisitor->argc['tradeNo'] = '2023120614513128015';

    //$testResponse = '{"responseCode":"1","responseMsg":"成功","errorCode":"0000","errorMsg":"success","responseTime":"2023-11-14 10:27:18","processId":"0f7c713e17663b36","result":{"data":{"records":[{"ORDERNO":"1000322023111410271524556","OUTORDERNO":"2023111300001","NONCESTR":"15YRej2023111410271867373","TOTALFEE":"423181","JUMPURL":"https://saastest.dbic.com.cn/dbic/pay/translate/authProposalTmp/dd42698d-ad55-441b-bd32-80dff7ba5e8d","QRCODE":"iVBORw0KGgoAAAANSUhEUgAAAMgAAADICAIAAAAiOjnJAAAD7klEQVR42u3aUW6EMAwFwL3/pbcn\nqFQaP8ch8z7RioUwSMbO5ysSyMcSCFgCloAlApaAJWCJgCVgCVgiYAlYApYIWAKWgCUCloAlYImA\nJWAJWCJgCVgClsggWJ9Afjt/4vjTe3x6753/tbLOYIEFFlhggQXWXFjp85wCt/N6dj0vsMACCyyw\nwAJrD6zEgj4tQp+e85R1SJwfLLDAAgsssMAC66/nqSq0q4rrCU1asMACCyywwAILrI7GadU509cG\nFlhggQUWWGCB1XGeRCFfNSDvPH7dEBossMACCyywLoR1yka8048n1hksx8ECCyywwJoFa1eqitzE\nA1i5hoOfCFhggQUWWGCBtbF4TzQYV0BUNVoTL0bVkPuKBilYYIEFFlhgvQxWoriuGiqnB9WdL1Ln\nywYWWGCBBRZYYM0q3hMP+JQNfdOuByywwAILLLDAeg+szgWd0IRMNIqr1uSKHaRggQUWWGCB9WJY\niYcxoeGZeMHS93LdEBossMACCyywwCoZ7q7817QPjk9jwAILLLDAAguss2FVNQ+riu5EMZ74TQJi\nDyawwAILLLDAAisFq/NhpwvnxIdF50vYOeAHCyywwAILLLD6YKVveAVQuqjfNfyuahqDBRZYYIEF\nFlhnFO+J4roKa9U5E5v40hsYj/8qBAsssMACC6xLYCWae+mBdLqxmXjxEi8nWGCBBRZYYIF1XvHe\nWYSmN+VVFfUrzUwb/cACCyywwAILrMqBcWJ4nABR9ZvOTYtggQUWWGCBBdbZsBLNus6GZ2KQnMAK\nFlhggQUWWGC9B1aiWZre+LYCtLNZWgX92xKwwAILLLDAAmtn8Z5ueCYK4U5wYIEFFlhggQUWWP9Z\nrPQGwMS1TftAqQpYYIEFFlhggXVGg3SlsK1qMK40QhPD3URRX7UxECywwAILLLDAOgNWetNcJ470\nQ003jfubpWCBBRZYYIEFVjemRLMx0dStArfr2l5VvIMFFlhggQXW5bBWFqgTYtULkB5gp4f6YIEF\nFlhggQXWe4bQnU3XXY3WKohVQ+X0BxBYYIEFFlhggdXXIJ22YW3vULb/A6XqQwossMACCyywwJoF\nq3PR05vvEtATxXV6aA0WWGCBBRZYYM2ClWgMJorfxL1UFePpZi9YYIEFFlhggXUvrDkb2fqL5ZUN\nfd/2gAUWWGCBBRZYp8KqKninfWSkAxZYYIEFFlhgvQfWLqBV11b1v+nzzCnkwQILLLDAAgusjoZh\nYoCaeBi7MHUO1HvAgQUWWGCBBRZYIuOLdxGwBCwBSwQsAUvAEgFLwBKwBCwRsAQsAUsELAFLwBIB\nS8ASsETAErAELBGwBCy5LT/qDwcmccydewAAAABJRU5ErkJggg=="}]}}}';

    $response = $IDock->policyPayment($shortName, $policyPaymentVisitor);

    if ($response->isSuccess()) {
        /*** @var $printer PolicyPaymentPrinter */
        $printer = $response->getPrinter();
        var_dump($printer->toArray());
    } else {
        var_dump($response->getError());
    }

    exit;
}

//文件上传
if (0) {
    //$testResponse = '{"resultDTO":{"resultCode":"B00Y0002","resultMess":"渠道接口管理平台提示:上传的附件大小超过了系统规定的范围,系统最大允许上传的单个附件大小为:10240KB"}}';
    $testResponse = '{"resultDTO":{"resultCode":"B00Y0002","resultMess":"渠道接口管理平台提示:投保单号：130888502023122700185871未查询到订单数据"}}';
    $uploadFileVisitor = new UploadFileVisitor();
    $uploadFileVisitor->inquiryNo = '0503132138820230000009';
    $uploadFileVisitor->biInquiryNo = '0503132088820230000009';
    $uploadFileVisitor->ciInquiryNo = '0503132088120230000009';
    $uploadFileVisitor->argc['tradeNo'] = '2023120614513128015';

    $uploadFileVisitor->fileAppend('10010', 'https://p0.itc.cn/q_70/images03/20220512/77ed76720a1f40ef94948761dda05655.jpeg');
    //$uploadFileVisitor->fileAppend('10010', 'http://static.flashmiao.com/file/202347/422997825.jpg');

    $response = $IDock->uploadFile($shortName, $uploadFileVisitor);

    if (!$response->isSuccess()) {
        var_dump($response->getError());
    } else {
        var_dump($response->getPrinter());
    }
    exit;
}

//投保单状态
if (1) {
    $testResponse = '{
  "dealFlag": "1",
  "dealMessage": "SUCCESS",
  "proposalDataDtoList": [
    {
      "handleText": "提交上级审核",
      "inputTime": "2024-05-30 11:11:57",
      "proposalNo": "0503132138820240020971",
      "riskCode": "1388",
      "riskList": [
        {
          "currency": "",
          "effectFlag": "",
          "planCode": "",
          "proposalNo": "0503132138820240020971",
          "riskCode": "C731",
          "subPolicyNo": "",
          "subProposalNo": "0503132088820240021626",
          "sumDiscount": 0,
          "sumGrossPremium": 0,
          "sumInsured": 0,
          "sumNetPremium": 0,
          "sumUWPremium": 0,
          "uwYear": "",
          "validInd": ""
        },
        {
          "currency": "",
          "effectFlag": "",
          "planCode": "",
          "proposalNo": "0503132138820240020971",
          "riskCode": "C601",
          "subPolicyNo": "",
          "subProposalNo": "0503132088120240023689",
          "sumDiscount": 0,
          "sumGrossPremium": 0,
          "sumInsured": 0,
          "sumNetPremium": 0,
          "sumUWPremium": 0,
          "uwYear": "",
          "validInd": ""
        }
      ],
      "riskName": "机动车组合险（2020）",
      "status": "9",
      "undwrtTime": "2024-05-30 11:12:01"
    }
  ],
  "resultDTO": {
    "resultCode": "SUCCESS",
    "resultMess": "接口调用成功"
  }
}';

    $proposalStatusVisitor = new ProposalStatusVisitor();
    $proposalStatusVisitor->inquiryNo = '0503132138820230000009';
    $proposalStatusVisitor->biInquiryNo = '0503132088820230000009';
    $proposalStatusVisitor->ciInquiryNo = '0503132088120230000009';
    $proposalStatusVisitor->argc['tradeNo'] = '2023120513412439603';

    $response = $IDock->proposalStatus($shortName, $proposalStatusVisitor);

    if (!$response->isSuccess()) {
        var_dump($response->getError());
    } else {
        var_dump($response->getPrinter());
    }

    exit;
}
